import { defineStore } from 'pinia'
import { PositionAdd } from '../utils/trueType'
export const useAddPosition = defineStore('addPosition', {
    state: () => ({
        isOpen: false,
        positionAdd: {
            id: -1,
            positionName: '',
            deptId: '',
            maxHeadcount: 1,
            status: 1,
            time: '',
            responsibility: ''
        } as PositionAdd
    }),
    actions: {
        setIsOpen(boolean:boolean){
            this.isOpen = boolean
        },
        setPositionAdd(positionAdd:PositionAdd){
            this.positionAdd = positionAdd
        },
        setPositionAddNull(){
            this.positionAdd = {
                id: -1,
                positionName: '',
                deptName: '',
                maxHeadCount: 1,
                status: 1,
                time: ''
            } as PositionAdd
        }
    },
    getters: {
        
    },
}
)